package com.guigu.qingcheng.orderservice.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.guigu.qingcheng.pojo.order.TbCategoryReport;
import com.guigu.qingcheng.utils.R;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author testjava
 * @since 2020-07-08
 */
public interface TbCategoryReportService extends IService<TbCategoryReport> {

    R findPage (@RequestParam("page") Integer page, @RequestParam("size") Integer size, @RequestBody Map<String,Object> searchMap );

    /**
     * 商品类目按日期统计(订单表关联查询)
     * @param date
     * @return
     */
    List<TbCategoryReport> categoryReports(LocalDate date);


    /**
     * 创建定时任务，每天凌晨1点统计昨天数据，插入到tb_category_report中
     */
    void createData();

    /**
     * 一级类目统计
     * @param date1
     * @param date2
     * @return
     */
    public List<Map> category1Count(String date1 , String date2 );
}
